package com.uzai.console.dto.groupsendjob;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * @Auther: liuqi
 * @Date: 2021/8/10 14:58
 * @Description:
 */
@ApiModel("群发任务关联会员查询条件参数")
@Data
public class GroupSendJobUserQueryParaDto{

    //----会员查询条件----
    @ApiModelProperty("注册来源列表")
    private List<Integer> regChannelList;
    @ApiModelProperty("注册时间开始")
    private Integer regTimeStart;
    @ApiModelProperty("注册时间结束")
    private Integer regTimeEnd;
    @ApiModelProperty("淘宝订单尾号")
    private Integer tbLastOrderNo;
    @ApiModelProperty("最后下单时间开始")
    private Integer lastOrderTimeStart;
    @ApiModelProperty("最后下单时间结束")
    private Integer lastOrderTimeEnd;
    @ApiModelProperty("快捷选择（0-未下单；1-下单；2-从未下单）")
    private Integer lastOrderType;
    @ApiModelProperty(value = "最近多少天下单对应的时间搓")
    private Integer lastOrderTypeTime;
    @ApiModelProperty("会员类型List")
    private List<Long> userTypeList;
    @ApiModelProperty("性别(0未知 1男 2女)")
    private Integer gender;
    @ApiModelProperty("会员备注查询列表")
    private List<String> remarkList;
    @ApiModelProperty("会员备注查询是否为空(1-启用查询; 0-不启用)")
    private Integer remarkNullFlag;
    @ApiModelProperty("备注排除列表")
    private List<String> remarkExcludeList;
    @ApiModelProperty("会员昵称查询列表")
    private List<String> nameList;
    @ApiModelProperty("会员昵称查询是否为空(1-启用查询; 0-不启用)")
    private Integer nameNullFlag;
    @ApiModelProperty("会员昵称排除列表")
    private List<String> nameExcludeList;
    @ApiModelProperty("自定义标签查询列表")
    private List<String> tagsList;
    @ApiModelProperty("自定义标签查询是否为空(1-启用查询; 0-不启用)")
    private Integer tagsNullFlag;
    @ApiModelProperty("自定义标签排除列表")
    private List<String> tagsExcludeList;

    @ApiModelProperty("会员标签查询列表")
    private List<Long> sysTagsList;
    @ApiModelProperty("会员标签查询是否为空(1-启用查询; 0-不启用)")
    private Integer sysTagsNullFlag;
    @ApiModelProperty("会员标签排除列表")
    private List<Long> sysTagsExcludeList;

    @ApiModelProperty("最小余额")
    private Double minBalance;
    @ApiModelProperty("最大余额")
    private Double maxBalance;
    @ApiModelProperty("最小积分")
    private Double minIntegral;
    @ApiModelProperty("最大积分")
    private Double maxIntegral;

    //----订单查询条件----
    @ApiModelProperty("平台(0-淘宝;1-京东;2-拼多多;3-唯品会;8-美团；9-饿了么;11-抖音;12-快手)")
    private Integer platform;
    @ApiModelProperty("订单创建时间开始")
    private Integer orderCreateTimeStart;
    @ApiModelProperty("订单创建时间结束")
    private Integer orderCreateTimeEnd;
    @ApiModelProperty("商品类目(三级类目)")
    private List<Integer> cidList;
    @ApiModelProperty("订单标题关键词查询列表")
    private List<String> orderTitleList;


    public boolean checkUserConditionIsAllNull(){
        if(regTimeStart ==null
            && regTimeEnd == null
            && tbLastOrderNo == null
            && lastOrderTimeStart == null
            && lastOrderTimeEnd == null
            && lastOrderType == null
            && lastOrderTypeTime == null
            && (userTypeList == null || userTypeList.size() == 0)
            && gender == null
            && (remarkList == null || remarkList.size() == 0)
            && remarkNullFlag == null
            && (remarkExcludeList == null || remarkExcludeList.size() == 0)
            && (nameList == null || nameList.size() == 0)
            && nameNullFlag == null
            && (nameExcludeList == null || nameExcludeList.size() == 0)
            && (tagsList == null || tagsList.size() == 0)
            && tagsNullFlag == null
            && (tagsExcludeList == null || tagsExcludeList.size() == 0)
            //会员标签
            && (sysTagsList == null || sysTagsList.size() == 0)
            //注册来源列表
            && (regChannelList == null || regChannelList.size() == 0)
            && sysTagsNullFlag == null
            && (sysTagsExcludeList == null || sysTagsExcludeList.size() == 0)
            //会员注册来源列表
            && (regChannelList == null || regChannelList.size() == 0)
            && minBalance == null
            && maxBalance == null
            && minIntegral == null
            && maxIntegral == null
        ){
            return true;
        }else{
            return false;
        }
    }

    public boolean checkOrderConditionIsAllNull(){
        if( platform == null
            &&  orderCreateTimeStart ==null
            && orderCreateTimeEnd == null
            && (cidList == null || cidList.size() == 0)
            && (orderTitleList == null || orderTitleList.size() == 0)
        ){
            return true;
        }else{
            return false;
        }
    }

}
